<!DOCTYPE HTML>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>WinA</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/box.css" />
    <script type="text/javascript" src="../script/public.js"></script>
    <style>
    p {
        color: #999;
        padding: 5px;
    }
    </style>
    <script type="text/javascript">
    apiready = function() {
        fixStatusBar(); //沉浸式效果，支持IOS7及Android4.4及以上
        //TODO
    };

    function sendH5EventToNative() {
        var ext = $('extra').value;
        if (!ext) {
            ext = "";
        }
        api.sendEvent({
            name: 'abc-sendEvent',
            extra: ext
        });
    }
    </script>
</head>

<body>
    <div id="wrap">
        <div id='header'>
            <div class="back" tapmode="back-active" onclick="api.closeWin()">返回</div>
            <h1>监听Html5事件</h1>
            <div class="adpt"></div>
        </div>
        <div id="main">
            <p>这里是窗口
                <br>请在[widget/html/wina.html]中实现你的UI及业务逻辑</p>
            <br>
            <br>
            <br>
            <div class='itemtitle'>测试发送事件给Native</div>
            <lable>设置发送给Native的数据</lable>
            <br>
            <input type="text" id="extra" placeholder="请输入任意数据" />
            <div class="clickbtn" tapmode="active" onclick="sendH5EventToNative()">发出事件</div>
        </div>
    </div>
</body>

</html>